<div class="onecolumn">
    <div class="header">
        <span>Quản lý chỉ mục</span>
    </div>
    <div class="content">
        <table class="data" width="100%" cellpadding="0" cellspacing="0" style="text-align: left">
            <thead>
                <tr>
                    <th style="width:10%">Số thứ tự</th>
                    <th style="width:40%">Tên chỉ mục</th>
                    <th style="width:20%">Lựa chọn</th>
                    <th style="width:30%">Trạng thái</th>
                </tr>
            </thead>
            <tbody>
                <?php 
                $number = 1;
                foreach($parentCategory as $parentCat):
                ?>
                <tr>
                    <td><?php echo $number ?></td>
                    <td><?php echo $parentCat['name_vn'] ?></td>
                    <td>
                        <a href="<?php echo site_url('admin/category/edit/' . $parentCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/icon_edit.png" alt="Sửa" class="help" title="Sửa"/></a> - 
                        <?php if($parentCat['status'] == 1): ?>
                        <a href="<?php echo site_url('admin/category/hide/' . $parentCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/folder.png" alt="Lưu trữ" class="help" title="Lưu trữ"/></a> - 
                        <?php else: ?>
                        <a href="<?php echo site_url('admin/category/show/' . $parentCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/accept.jpg" alt="Hiển thị" class="help" title="Hiển thị"/></a> - 
                        <?php endif; ?>
                        <a href="<?php echo site_url('admin/category/delete/' . $parentCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/icon_delete.png" alt="Xóa" class="help" title="Xóa"/></a>
                    </td>
                    <td>
                        <?php if($parentCat['status'] == 1): ?>
                        <span style="color:green;font-weight:bold">Hiển thị</span>
                        <?php else: ?>
                        <img src="<?php echo STATIC_DOMAIN ?>images/admin/ico_hourglass.jpg" alt="Waiting"/> Lưu trữ
                        <?php endif; ?>
                    </td>
                </tr>
                    <?php 
                        if($parentCat['childrenCategory']):
                            foreach($parentCat['childrenCategory'] as $childCat):
                    ?>
                            <tr>
                                <td> <?php echo $number ?>|---------------- </td>
                                <td><?php echo $childCat['name_vn'] ?></td>
                                <td>
                                    <a href="<?php echo site_url('admin/category/edit/' . $childCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/icon_edit.png" alt="Sửa" class="help" title="Sửa"/></a> - 
                                    <?php if($childCat['status'] == 1): ?>
                                    <a href="<?php echo site_url('admin/category/hide/' . $childCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/folder.png" alt="Lưu trữ" class="help" title="Lưu trữ"/></a> - 
                                    <?php else: ?>
                                    <a href="<?php echo site_url('admin/category/show/' . $childCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/accept.jpg" alt="Hiển thị" class="help" title="Hiển thị"/></a> - 
                                    <?php endif; ?>
                                    <a href="<?php echo site_url('admin/category/delete/' . $childCat['id']) ?>"><img src="<?php echo STATIC_DOMAIN ?>images/admin/icon_delete.png" alt="Xóa" class="help" title="Xóa"/></a>
                                </td>
                                <td>
                                    <?php if($childCat['status'] == 1): ?>
                                    <span style="color:green;font-weight:bold">Hiển thị</span>
                                    <?php else: ?>
                                    <img src="<?php echo STATIC_DOMAIN ?>images/admin/ico_hourglass.jpg" alt="Waiting"/> Lưu trữ
                                    <?php endif; ?>
                                </td>
                            </tr>
                    <?php 
                            endforeach;
                        endif; ?>
                <?php ++$number; ?>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
<!-- End one column window -->